home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / UTILITY / DO1002.ARJ / FILES.SCR < prev    next >
Text File  |  1991-12-04  |  1KB  |  44 lines

  1. * SCRIPT: Files.scr
  2. .pg wi full clr
  3. »ye«
  4. /BIG FILES 14
  5. .#
  6. /FRAME ~179 ~196 ~217 ~191 ~192 ~218
  7. /BOX 10 1 59 7
  8. .bl
  9. /DRAW V 60 2 8 0 ░
  10. /DRAW H 8 11 60 0 ░
  11. /FRAME RESET
  12. .wi 9 10 80 25
  13. »%t«DO»#« has four commands which let you read and write »ye«TEXT
  14. files»#«. These commands are not as powerful as those in
  15. languages like BASIC, "C", or PASCAL. But, they allow you
  16. to »cy«store and retrieve information from text files»#« which you
  17. can use in your scripts.
  18.  
  19. .pg clr
  20. To read or write from a file you must first »cy«open»#« it and »cy«assign»#« it
  21. to a file »ye«HANDLE»#«. »%t«DO»#« can have »ma«10»#« files open at one time.
  22. A file handle is a number between »ye«1»#« and »ma«10»#«. Once a file is
  23. opened, the other commands use the file handle to refer to the
  24. file rather than the filename.
  25.  
  26. .pg clr
  27. To process a text file, use the following basic structure:
  28.  
  29.     »%t«/OPEN»cy« {handle} {filename} . . .
  30.  
  31.     »%t«/READ»cy« {handle} . . .
  32.         or
  33.     »%t«/WRITE»cy« {handle} . . .
  34.  
  35.     »%t«/CLOSE»cy« {handle}
  36.  
  37. .pg clr #
  38. Files can be opened for »cy«R»#«eading or »cy«W»#«riting, but »ye«not both at the
  39. same time»#«.
  40.  
  41. The following screens present each of the file-related commands
  42. in detail.
  43. /ENDEXEC
  44.